<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <link rel='stylesheet' href='/stylesheets/login.css' />
    <link rel="stylesheet" href='/stylesheets/reset.css' />
    <link rel="stylesheet" href="/stylesheets/iconfont.css" />
  </head>
  <body>
    <div class="login-body">
    <div class="login-hd">
    <img src="../images/shopex.png" alt="shopex" class="logo">
  </div>
  <!-------------------->
 <div class="center-wrap" id="centerWrap">
 	<!---->
    <div class="login-center">
      <div class="bd-logo">
        <img src="../images/ecshop-logo.png" alt="ECSHOP" width="373" height="103" border="0">
      </div>
    </div>
    <!---->
    <div class="z-bd">
      <div class="login-panel" id="loginPanel">
        <div class="controls first">
          <p class="iconfont icon-tubiaozhizuomoban" >           
          </p>
          <input  id="username" name="username" placeholder="用户名" type="text">
        </div>
        <!---->
        <div class="controls two active">
          <p class="iconfont icon-dunpaisuo-tianchong">
          </p>
          <input id="psw" name="password" placeholder="密码" type="password">
        </div>
        <!---->
                  <div class="controls third active">
            <p class="iconfont icon-suozi">
           
            </p>
            <input name="captcha" class="capital" placeholder="验证码" type="text">

            <div class="" style="position: absolute; right: 8px; top: 8px;" id="number_div">
              <img src="../images/index3.png" alt="CAPTCHA"  style="cursor: pointer;" title="换一张" width="102" height="34" border="1">
            </div>
          </div>
          <!---->
        <div class="last">
          		<button class="btn-a" onclick="login()">登录</button>

        </div>
        <!---->
        <div class=" bside" style="border: none">
         <input value="1" name="remember" id="remember" type="checkbox">
         
    </div>
         
          <label>保存登录信息</label>
          <a class="link-forget cl-link-blue" href="#">忘记密码?</a>
          <a class="link-home cl-link-blue" href="#">去店铺首页&gt;&gt;</a>
        </div>
      </div>
    </div>
 </div>
    </form>
  </body>
  	<script type="text/javascript" src="/javascripts/jquery-1.11.3.JS"></script>
  <script type="text/javascript">
  	
	function login() {
		//console.log($("#username").val(),$("#psw").val())
		$.ajax({
			url: "/api/login4ajax",
			type: "post",
			data: {
				usrname: $("#username").val(),
				psw: $("#psw").val()
			},
			success: function(res) {
				console.log(res);
				if(res.code == 1) {
					alert(res.message);
					console.log(res.message);
					location.href = "/list?r=" + new Date().getTime();
				} else {
					//console.log(res.message);
					alert(res.message);
				}
			}
		})
	}
</script>
</html>
